package com.wh.springboot.controller;

import com.wh.springboot.common.Result;
import com.wh.springboot.service.ChinaTotalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * 中国病情腾讯API数据统计
 */
@RestController
@RequestMapping("/china_total")
public class ChinaTotalController {
    @Autowired
    private ChinaTotalService chinaTotalService;

    /**
     * 查看最后一个的id
     * @return
     */
    @GetMapping
    public Result findOne() {
        //1.找到ID最大的那一条数据
        Integer id = chinaTotalService.maxID();
        //2.根据ID进行查找数据
        return Result.success(chinaTotalService.getById(id));
    }


}
